// 显示公告
var boardList = [];
Classify.queryExt("settings", "board", true, "", function(v) {
    var content = "";
    for (var i in v) {
        content += v[i].content + " &nbsp; &nbsp; ";
        boardList.push(v[i].content);
    }
    $("#noticeDom marquee").html(content);
});

function popNotice(e) {
    var o = '';
    for (var i in boardList) {
        o += boardList[i] + "<br>";
    }
    o = o || '欢迎来到 K K彩票网！';
    layer.open({
        type: 1,
        title: '<span class="gundong">最新公告</span>',
        shadeClose: !0,
        shade: .8,
        area: ["803px", "30%"],
        content: '<div style="padding:10px 20px;"> ' + o + " </div>"
    })
}
function hezuo() {
    layer.open({
        type: 1,
        title: '<span class="gundong"></span><img src="login/img/tl1.png" alt="" />',
        shadeClose: !0,
        shade: .8,
        area: ["803px", "85%"],
        content: $("#m1")
    })
}
function youhui() {
    layer.open({
        type: 1,
        title: '<span class="gundong"></span><img src="login/img/tl2.png" alt="" />',
        shadeClose: !0,
        shade: .8,
        area: ["803px", "85%"],
        content: $("#m2")
    })
}
function answer() {
    layer.open({
        type: 1,
        title: '<span class="gundong"></span><img src="login/img/tl3.png" alt="" />',
        shadeClose: !0,
        shade: .8,
        area: ["803px", "80%"],
        content: $("#m3")
    })
}
function about() {
    layer.open({
        type: 1,
        title: '<span class="gundong"></span><img src="login/img/tl4.png" alt="" />',
        shadeClose: !0,
        shade: .8,
        area: ["803px", "80%"],
        content: $("#m4")
    })
}
$(function() {
    $("#slideshow").length && $("#slideshow").cycle({
        fx: "fade",
        speed: "slow",
        timeout: 5e3,
        pager: "#slider_nav",
        pagerAnchorBuilder: function(e, n) {
            return "#slider_nav li:eq(" + e + ") a"
        }
    });

    $(".btn-submit").click(function() {
        var account = $("#username").val().trim();
        var p = $("#login-password").val().trim();
        if (!account) {
            alert("请输入账号！");
            return false;
        }
        if (!p) {
            alert("请输入登录密码！");
            return false;
        }

        // 登录请求
        urlInfo.params.try = 0;
        CMD.signin(account, p, "pc", function(r) {
            Util.jumpUrl({
                file: 'agreement.html',
                try: 0,
            });
        }, function(message) {
            if (message)
                message = message.replace("登入认证失败！", "账号或登录密码不对！")
            alert(message || '账号或登录密码不对！');
        });
    });
    $(".btn-reg").click(function() {
        Util.jumpUrl({
            file: "register.html",
        })
    });
    $("#register").click(function() {
        Util.jumpUrl({
            file: "register.html",
        })
    });
    $(".btn-in").click(function() {
        urlInfo.params.try = 1;
        CMD.trial(function(r) {
            Util.jumpUrl({
                file: 'agreement.html',
                try: 1,
            });
        });
    })
});
